package samples
{
	import flash.events.Event;
	import marcel.debug.*;
	import marcel.display.gui.components.CheckBox;
	import marcel.display.gui.components.ComboBox;
	import marcel.display.gui.components.InputText;
	import marcel.display.gui.components.List;
	import marcel.display.gui.components.Scroller;
	import marcel.display.gui.components.Slider;
	import marcel.display.View;
	import marcel.events.*;
	
	
	public class ComponentsSample extends View
	{
		public function ComponentsSample()
		{
			orientation = ORIENTATION_VERTICAL;
			gap = 10;
			
			var slider:Slider = new Slider(0, 100);
			slider.setValue(50);
			addChild(slider);
			
			addChild(new CheckBox("I agree", "form_checkbox"));
			
			addChild(new InputText("form_label"));
			
			var li:List = new List(300);
			li.resizeTracker = true;
			li.addEventListener(Event.CHANGE, onList);
			var data:Array = [];
			for (var i:int = 0; i < 10; i++) data.push( { label:"item " + i, data:"data " + i } );
			li.data = data;
			addChild(li);
			
			addChild(new Scroller(100, false));
			
			var combo:ComboBox = new ComboBox(200, 5);
			combo.setLabel("Please select");
			combo.data = data;
			//combo.selectedIndex = 3;
			addChild(combo);			
		}
		
		private function onList(e:Event):void 
		{
			debug(e.target.getValue());
		}
	}
}